﻿using System;

namespace diantou.web.ajax.enterprise
{
    /// <summary>
    /// 邮件模版
    /// </summary>
    [fastCSharp.code.cSharp.ajax(IsPool = true)]
    class mail : permissionHandle<mail>
    {
        /// <summary>
        /// 添加邮件模版
        /// </summary>
        /// <param name="value"></param>
        /// <param name="onReturn"></param>
        public void Append(diantou.examDataAccess.enterpriseMail value, Action<fastCSharp.net.returnValue<int>> onReturn)
        {
            value.UserId = currentUser.Id;
            diantou.examDataAccess.tcpCall.enterpriseMail.append(value, onReturn);
        }
        /// <summary>
        /// 修改邮件模版
        /// </summary>
        /// <param name="value"></param>
        /// <param name="onReturn"></param>
        public void Rework(diantou.examDataAccess.enterpriseMail value, Action<fastCSharp.net.returnValue<bool>> onReturn)
        {
            value.UserId = currentUser.Id;
            diantou.examDataAccess.tcpCall.enterpriseMail.rework(value, onReturn);
        }
        /// <summary>
        /// 修改邮件模版
        /// </summary>
        /// <param name="id"></param>
        /// <param name="onReturn"></param>
        public void Delete(int id, Action<fastCSharp.net.returnValue<bool>> onReturn)
        {
            diantou.examDataAccess.tcpCall.enterpriseMail.delete(id, currentUser.Id, onReturn);
        }
        /// <summary>
        /// 发送考试邀请邮件
        /// </summary>
        /// <param name="examId"></param>
        /// <param name="onReturn"></param>
        public void SendInvitation(int examId, diantou.examDataAccess.enterpriseMail mail, string name, string email, string mobile, Action<fastCSharp.net.returnValue<int>> onReturn)
        {
            diantou.examDataAccess.tcpCall.enterpriseMail.sendInvitation(examId, mail, name, email, mobile, currentUser.Id, onReturn);
        }
        /// <summary>
        /// 发送考试邀请邮件
        /// </summary>
        /// <param name="invitationId"></param>
        /// <param name="onReturn"></param>
        public void ReInvitation(int invitationId, diantou.examDataAccess.enterpriseMail mail, Action<fastCSharp.net.returnValue<bool>> onReturn)
        {
            diantou.examDataAccess.tcpCall.enterpriseMail.reInvitation(invitationId, mail, currentUser.Id, onReturn);
        }
        /// <summary>
        /// 发送通知邮件
        /// </summary>
        /// <param name="invitationId"></param>
        /// <param name="onReturn"></param>
        public void SendMessage(int userId, diantou.examDataAccess.enterpriseMail mail, Action<fastCSharp.net.returnValue<bool>> onReturn)
        {
            diantou.examDataAccess.tcpCall.enterpriseMail.sendMessage(userId, mail, currentUser.Id, onReturn);
        }
        /// <summary>
        /// 发送考试邮件
        /// </summary>
        /// <param name="id"></param>
        /// <param name="onReturn"></param>
        public void SendExam(int id, int examId, diantou.examDataAccess.enterpriseMail.sendTo sendTo, Action<fastCSharp.net.returnValue<int>> onReturn)
        {
            diantou.examDataAccess.tcpCall.enterpriseMail.sendExam(id, examId, sendTo, currentUser.Id, onReturn);
        }
        /// <summary>
        /// 发送考试邮件
        /// </summary>
        /// <param name="id"></param>
        /// <param name="onReturn"></param>
        public void SendExamToUserIds(int id, int examId, int[] userIds, Action<fastCSharp.net.returnValue<int>> onReturn)
        {
            diantou.examDataAccess.tcpCall.enterpriseMail.sendExam(id, examId, userIds, currentUser.Id, onReturn);
        }
        /// <summary>
        /// 邮件测试
        /// </summary>
        /// <param name="value"></param>
        /// <param name="email"></param>
        /// <param name="examId"></param>
        /// <param name="onReturn"></param>
        public void Test(diantou.examDataAccess.enterpriseMail value, string email, int examId, Action<fastCSharp.net.returnValue<bool>> onReturn)
        {
            diantou.examDataAccess.tcpCall.enterpriseMail.test(value, email, examId, currentUser.Id, onReturn);
        }
        /// <summary>
        /// 短信测试
        /// </summary>
        /// <param name="value"></param>
        /// <param name="mobile"></param>
        /// <param name="examId"></param>
        /// <param name="onReturn"></param>
        public void TestSms(diantou.examDataAccess.enterpriseMail value, ulong mobile, int examId, Action<fastCSharp.net.returnValue<bool>> onReturn)
        {
            diantou.examDataAccess.tcpCall.enterpriseMail.test(value, mobile, examId, currentUser.Id, onReturn);
        }
    }
}
